package com.zhj.user.controller;

import com.zhj.user.entity.vo.WxLoginResponseVO;
import com.zhj.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/wx")
@RestController
@Api(tags = "微信登录相关接口")
@Validated
public class WxLoginController {

    @Resource
    private UserService userService;

    @GetMapping("login")
    @ApiOperation(value = "微信登录接口")
    public WxLoginResponseVO login(@RequestParam(value = "jsCode") String jsCode) {
        return userService.loginForWx(jsCode);
    }

}
